package com.haoyu.number.Runnable;

/**
 * @author: 蒿雨
 * @create: 2021-12-07 16:50
 * @description:
 */
public class User01 implements Runnable {
    @Override
    public void run() {
        int a = fun1();
        System.out.println("1素数个数为：" + a);
    }
    private static synchronized int fun1() {
        //素数个数
        int sum = 0;
        for (int i = 2; i < 100000; i++) {
            int j = 2;
            while (i % j != 0) {
                j++;
            }
            if (j == i) {
                sum++;
            }
        }
        return sum;
    }
}
